<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
  <link rel="stylesheet" href="../css/index.css">
  <style lang="">
    .jfList .label{
      width: 130px;
    }
    li.item-content{
      margin-top: 10px;
    }
  </style>
  <title>积分记录</title>
</head>

<body class="jfList page-group">
  <div class="page">
    <!-- //<header class="bar bar-nav" id="golbalHeader"></header> -->

    <!-- 这里是页面内容区 -->
    <div class="content">
      <div class="content-block">
        <div class="card-content">
          <div class="list-block media-list">
            <ul>

            </ul>
            <p class="moreInfo" onclick="jf.loadMore()"></p>
          </div>
        </div>

      </div>
    </div>

  </div>
  <!-- 底部 -->
  <!-- <nav class="bar bar-tab" id="golbalFooter"></nav> -->
  <div id="modal">
    <li class="item-content">
      <div class="item-inner">
        <div class="item-title-row">
          <div class="item-title flex-box">
            <span class="label">时间</span>
            <span class="skinValue createTime"></span>
          </div>
        </div>
        <div class="item-title-row">
          <div class="item-title flex-box">
            <span class="label">变化原因</span>
            <span class="skinInfo dsc"></span>
          </div>
        </div>

        <div class="item-title-row">
          <div class="item-title flex-box">
            <span class="label">推荐奖励积分</span>
            <span class="skinInfo usableCashScore"></span>
          </div>
        </div>
        <div class="item-title-row">
          <div class="item-title flex-box">
            <span class="label">消费奖励积分</span>
            <span class="skinInfo usableUncashScore"></span>
          </div>
        </div>
      </div>
    </li>
  </div>
  </div>
  <!-- 标题栏 -->

</body>
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<script type="text/javascript" src="../js/index.js"></script>
<script type="text/javascript">
  var jf = (function ($) {
    $.init()
    var jf = new ST({
      golbalHeaderText: '积分记录',
      golbalHeaderFunc: function () {
        window.history.back()
      },
      jfList: {
        page: 1,
        pageSize: 5
      }
    })
    jf.loadMore = function () {
      jf.jfList.page++
        jf.http('getJfList')
    }
    jf.pushAjax({
      getJfList: {
        url: '/app/api/private/money/scoreLogs',
        data: jf.jfList
      }
    })
    jf.pushAjaxSuccess({
      getJfList: function (res) {
        if (res.code === '1') {
          console.log(res)
          res.data.scoreLogs.forEach(function (ele) {
            var li = $('#modal li').clone()
            li.find('.createTime').text(ele.createTime)
            li.find('.dsc').text(ele.dsc)
            li.find('.usableCashScore').text(ele.usableCashScore)
            li.find('.usableUncashScore').text(ele.usableUncashScore)
            $(li).appendTo($('ul'))
          })
          if (res.data.scoreLogs.length < 5) {
            $('.moreInfo').text('没有更多数据')
          } else {
            $('.moreInfo').text('点击加载更多')
          }
        }
      }
    })

    jf.http('getJfList')
    jf.render()

    return jf
  })($)
</script>

</html>